package cn.edu.nuc.article.util;
import cn.edu.nuc.article.entity.User;
import cn.edu.nuc.article.service.UserService;
import cn.edu.nuc.article.util.Sm3Utils;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.springframework.beans.factory.annotation.Autowired;

import java.security.*;
import java.security.spec.ECGenParameterSpec;
import java.util.Arrays;

public class test1{
    @Autowired
    private UserService userService;
    private static String test="123456";
    public static void main(String[] args) throws NoSuchAlgorithmException,
            InvalidAlgorithmParameterException {
        Sm3Utils sm3 = new Sm3Utils();

        String result = sm3.encrypt(test);
        System.out.println("明文："+test);
        System.out.println("哈希值："+result);
       // User user = userService.loginValidate(loginname, afterEncode);
    }
}